/*
 clear .css file by nodejs 
*/
import React, { Component }from 'react'
import PropTypes from 'prop-types'
export default class Header extends Component{
  static contextTypes={
    router:PropTypes.object.isRequired,
  }
  static defaultProps = {
    leftBtnTouch:()=>{console.log(this)},
    rightIconTouch:()=>{console.log(this)},
  };
  constructor(props){
    super(props)
  }
  componentDidMount(){
    
  }
  render(){
    let {
      className,title,
      leftBtnTouch } = this.props
    return (
      <div className={`header ${className || ''}`}>
        <div className='header-l'>
            <i className="iconfont icon-fanhui1" onClick={leftBtnTouch}></i>
            <span className="title">{title}</span>
        </div>
        <div className='header-r'>
            <i className="iconfont icon-wode" onClick={()=>{
              this.context.router.history.push('/account')
            }}></i>
            <i className="iconfont icon-gouwuche01" onClick={() =>{
                this.context.router.history.push('/cart')
            }}></i>
        </div> 
       
      </div>
    )
  }
}



